package com.xul.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xul
 * @create 2021-07-29 10:16
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 添加访问的地址
        String urlPath = "/auth/member/to/reg/page.html";
        // 目标视图的名称,将来拼接"prefix:classPath:/templates" "suffix: .html"前后缀
        String viewName = "member-reg";
        // 添加view-controller
        // 跳转到注册页面
        registry.addViewController(urlPath).setViewName(viewName);
        // 跳转开始页面
        // registry.addViewController("/").setViewName("portal");
        // 跳转到登录页面
        registry.addViewController("/auth/member/to/login/page.html").setViewName("member-login");
        // 跳转到登录后的主页面
        registry.addViewController("/auth/member/to/center/page.html").setViewName("member-center");
        // 跳转到我要众筹页面
        registry.addViewController("/member/my/crowd.html").setViewName("member-crowd");
    }
}
